From: Keir Fraser Date: Thu, 1 Apr 2010 08:55:27 +0000 (+0100) Subject: Allow all unused GSI to be configured via IO-APIC by new pv_ops dom0 X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~12450 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=2b6f2f6805276aaec45d83088c11eeb8d74bb195;p=xen.git Allow all unused GSI to be configured via IO-APIC by new pv_ops dom0 Currently Xen disallows setting up any GSI < 16. This makes it impossible by the kernel to use any PCI devices without ACPI override but a mapping to this interrupts via IO-APIC. The patch allows all unused interrupts to be setup via IO-APIC. Signed-off-by: Bastian Blank --- diff --git a/xen/arch/x86/mpparse.c b/xen/arch/x86/mpparse.c index 1917862cd3..95aff543f2 100644 --- a/xen/arch/x86/mpparse.c +++ b/xen/arch/x86/mpparse.c @@ -1103,6 +1103,7 @@ int mp_register_gsi (u32 gsi, int triggering, int polarity) int ioapic = -1; int ioapic_pin = 0; int idx, bit = 0; + /* * Mapping between Global System Interrups, which * represent all possible interrupts, and IRQs @@ -1126,6 +1127,9 @@ int mp_register_gsi (u32 gsi, int triggering, int polarity) if (ioapic_renumber_irq) gsi = ioapic_renumber_irq(ioapic, gsi); + if (!(irq_to_desc(gsi)->status & IRQ_DISABLED)) + return -EEXIST; + /* * Avoid pin reprogramming. PRTs typically include entries * with redundant pin->gsi mappings (but unique PCI devices); diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c index b0d777a6e8..baaff24ba2 100644 --- a/xen/arch/x86/physdev.c +++ b/xen/arch/x86/physdev.c @@ -476,12 +476,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg) ret = -EINVAL; if ( setup_gsi.gsi < 0 || setup_gsi.gsi >= nr_irqs_gsi ) break; - /* GSI < 16 has been setup by hypervisor */ - if ( setup_gsi.gsi >= 16 ) - ret = mp_register_gsi(setup_gsi.gsi, setup_gsi.triggering, - setup_gsi.polarity); - else - ret = -EEXIST; + ret = mp_register_gsi(setup_gsi.gsi, setup_gsi.triggering, + setup_gsi.polarity); break; } default: